<!DOCTYPE html>
<html lang="zh-CN">

{include file="public:header"}

<body ontouchstart="">
{include file="public:nav"}
{include file="public:right"}

<!--电脑端banner-->
<div class="banner-big banner-all" style="background-image: url({$lbp.image});"></div>

<!--手机端banner图-->
<div class="banner-small banner-all" style="background-image: url({$lbm.image});"></div>

<!--分页公共标题-->
<div class="nav">
  <div class="nav-top">
    <div class="nav-box mid clearfix">
      <div class="nav-float float-lt clearfix">
      	<div class="nav-icon float-lt"></div>
        <div class="nav-bread float-lt">
          <span>联系我们</span>
        </div>
      </div>
    </div>
  </div>
  <div class="product-bd mid">
    <h5 class="group-title">
          联系我们<span class="group-word">contact us</span>
        </h5>
    <form action="{:url('Call/save')}" method="post" id="logoForm">
      <div class="form clearfix">
        <div class="form-item">
        	<div class="form-cell form-wei">
            <input type="text" class="form-ipt" id="username" name="username" placeholder="请输入您的姓名"  />
          </div>
        </div>
        <div class="form-item">
          <div class="form-cell form-wei">
            <select class="form-ipt" name="pid"  />
            <option value="" style="color: #999;" hidden>请选择业务类型</option>
            {volist name="res" id="v"}
        <option value="{$v.ty_id}">{$v.ty_name}</option>
      {/volist}
            </select>
          </div>
        </div>
        <div class="form-item">
          <div class="form-cell form-wei">
            <input type="tel" class="form-ipt" name="phone" id="phone" placeholder="请输入手机号" />
          </div>
        </div>
        <div class="form-cell form-txt">
          <textarea class="form-ipt form-area" id="form-area" name="content" placeholder="请输入留言..."></textarea>
        </div>
        <div class="form-cell form-txt">
          <button type="submit" class="form-btn">确认提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script>
$(function(){
	$('#logoForm').ajaxForm({
		beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
		success: complete, // 这是提交后的方法
		dataType: 'json'
	});
	
	function checkForm(){
	   var username = $("#username").val();
	   if($.trim(username) == ''){
		   layer.msg("请输入您的姓名");return false;
	   }
	   var pid = $("select[name=pid]").val();
	   if(pid == ''){
		   layer.msg("请选择业务类型");return false;
	   }
	   var phone = $("#phone").val();
	   var telReg = !!phone.match(/^(0|86|17951)?(13|15|17|18|14|16|19)[0-9]{9}$/);
	   if(telReg == false){
		   layer.msg("请输入正确的手机号!");return false;
		}
    }

	function complete(data){
		if(data.status==1){
			layer.alert(data.msg, {icon: 5}, function(index){
 			layer.close(index);
 			window.location.href=data.url;
			});
			
		}else{
			layer.alert(data.msg, {icon: 6}, function(index){
 			layer.close(index);
 			window.location.href=data.url;
			});
			
		}
	}
 
});

</script>
<!--地图-->
<div class="map-container">
	<div id="container"></div>
</div>
<div class="nav">
  <div class="product-bg mid">
    <ul class="contact-list clearfix">
      <li class="contact-item">
        <div class="contact-box">
          <div class="contact-icon"></div>
          <h6 class="contact-title">
            公司地址
          </h6>
          <p class="contact-txt">{$sys.addr}</p>
        </div>
      </li>
      <li class="contact-item">
        <div class="contact-box">
          <div class="contact-icon"></div>
          <h6 class="contact-title">
            客服热线
          </h6>
          <p class="contact-txt"><span>{$sys.telphone}</span><span>{$sys.phone}</span></p>
        </div>
      </li>
      <li class="contact-item">
        <div class="contact-box">
          <div class="contact-icon"></div>
          <h6 class="contact-title">
            电子邮件
          </h6>
          <p class="contact-txt">{$sys.email}</p>
        </div>
      </li>
    </ul>
  </div>
</div>

{include file="public:footer"}


<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=aq0gKv1RBFHGWX76ZnkBfr9K2pwVkGTw"></script>
<script type="text/javascript">
var map = new BMap.Map("container"); // 创建地图实例  
var point = new BMap.Point({$sys.longs},{$sys.lats}); // 创建点坐标 
var marker = new BMap.Marker(point);  // 创建标注
  map.addOverlay(marker);              // 将标注添加到地图中
map.centerAndZoom(point, 15); // 初始化地图，设置中心点坐标和地图级别

map.setMapStyle({style:'grayscale'});
map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放

//地图控件
//map.addControl(new BMap.NavigationControl());    
//map.addControl(new BMap.ScaleControl());    
//map.addControl(new BMap.OverviewMapControl());    
//map.addControl(new BMap.MapTypeControl());

var opts = {    
    width : 250,     // 信息窗口宽度    
    height: 100,     // 信息窗口高度    
    title : "{$sys.name}"  // 信息窗口标题   
}    
var infoWindow = new BMap.InfoWindow("地址:{$sys.addr}", opts);  // 创建信息窗口对象    
map.openInfoWindow(infoWindow, map.getCenter());      // 打开信息窗口

marker.addEventListener("click", function(){          
    map.openInfoWindow(infoWindow,point); //开启信息窗口
  });

</script>
</body>

</html>